import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/', redirect:'/manage/home' },
    { path: '/manage', component: () => import('../views/Manager.vue'),
      children:[
        {path: 'home', meta:{name:'首页'}, component: () => import('../views/Home.vue'),},
        {path: 'admin', meta:{name:'管理员信息'}, component: () => import('../views/Admin.vue')},
        {path: 'user', meta:{name:'普通用户信息'}, component: () => import('../views/User.vue')},
        { path: 'person', meta:{name:'个人信息'}, component: () => import('../views/Person.vue')},
        { path: 'updatePassword', meta:{name:'修改密码'}, component: () => import('../views/UpdatePassword.vue')},
        { path: 'notice', meta:{name:'系统公告'}, component: () => import('../views/Notice.vue')},
        { path: 'category', meta:{name:'旅游分类信息'}, component: () => import('../views/Category.vue')},
        { path: 'introuction', meta:{name:'旅游攻略信息'}, component: () => import('../views/Introuction.vue')},
        { path: 'apply', meta:{name:'请假申请信息'}, component: () => import('../views/Apply.vue')},
        { path: 'book', meta:{name:'借阅图书信息'}, component: () => import('../views/Book.vue')},
        { path: 'record', meta:{name:'图书借阅记录'}, component: () => import('../views/Record.vue')},
        { path: 'lunbo', meta:{name:'轮播图片上传'}, component: () => import('../views/Lunbo.vue')},
      ]
    },
    { path: '/front', component: () => import('../views/Front.vue'),
      children:[
        {path: 'home', meta:{name:'首页'}, component: () => import('../views/FrontHome.vue'),},
        {path: 'introductionDeta', meta:{name:'攻略详情页'}, component: () => import('../views/IntroductionData.vue'),}
      ]
    },
    // { path: '/front/home', component: () => import('../views/Front.vue'), },
    { path: '/login', component: () => import('../views/Login.vue'), },
    { path: '/register', component: () => import('../views/Register.vue'), },
    { path: '/notFound', component: () => import('../views/404.vue'), },
    { path: '/:pathMatch(.*)', redirect:'/notFound' },
  ],
})

export default router
